package ru.spb.osll.myfit.common.chart;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;

public class Launch implements Comparable<Launch>, Serializable {
  private static final long serialVersionUID = 4002957210968810086L;

  private String m_id;
  private Date m_date;
  private List<String> m_chartsList = new ArrayList<String>();

  public Launch() {}

  public Launch(String id) {
    m_id = id;
  }

  public void setDate(Date date) {
    m_date = date;
  }
  @Override
  public int compareTo(Launch launch) {
    return m_date.before(launch.m_date) ? -1 : m_date.after(launch.m_date) ? 1 : 0;
  }

  public void addAllCharts(Collection<String> chartList) {
    m_chartsList.addAll(chartList);
  }

  public Date getDate() {
    return m_date;
  }

  public List<String> getChartNames() {
    return m_chartsList;
  }

  public String getId() {
    return m_id;
  }
}